package com.csht.service.Impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.csht.mapper.CshtUserMapper;
import com.csht.model.CshtUser;
import com.csht.service.LoginService;

/**
 * 登录service接口
 * @author chenhuiyan
 *
 */
@Service
public class LoginServiceImpl implements LoginService {
	
	@Autowired
	private CshtUserMapper cshtUserMapper;
	

	/**
	 * 根据用户名或手机号查找用户
	 */
	@Override
	public CshtUser getUserByUsernameOrTel(String usernameOrTel) throws Exception {
		CshtUser cshtUser = cshtUserMapper.getUserByUsernameOrTel(usernameOrTel);
		return cshtUser;
	}


	/**
	 * 更新登录失败次数
	 */
	@Override
	public void updateLoginFailTime(CshtUser cshtUser) throws Exception {
		cshtUserMapper.updateLoginFailTime(cshtUser);
	}

}
